<%--
  Created by IntelliJ IDEA.
  User: LT
  Date: 2018-11-28
  Time: 8:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <jsp:include page="${pageContext.request.contextPath}/common/tag.jsp"></jsp:include>
</head>
<body>
<!-- 为ECharts准备一个具备大小（宽高）的Dom -->
<div id="main" style="width: 600px;height:400px;"></div>
<script type="text/javascript">
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('main'));
    myChart.showLoading() ;
    $.post('/house/queryGroupXiaoQu',function (data) {
        myChart.hideLoading();
        var data1 = [] ;
        var data2=[] ;

        $.each(data, function (index,item) {
            data1.push(item.xiaoqu) ;
            data2.push(item.xiaoqucount) ;
        }) ;

        myChart.setOption({
            title: {
                text: '按小区统计'
            },
            tooltip: {},
            legend: {
                data:['小区统计']
            },
            xAxis: {
                data: data1
            },
            yAxis: {},
            series: [{
                name: '小区统计',
                type: 'bar',
                data: data2
            }]
        }) ;
    })


</script>
</body>
</html>
